"""
    @Author  ：思念 
    @File    ：9.使用WebPage请求带有加密配置的网站.py
    @Date    ：2025/4/9 15:49 
"""
from DrissionPage import WebPage
from DrissionPage.common import By

url = 'https://www.handebook.com/web/#/1234/document?type=1&keyword=%E5%A4%8D%E8%AF%95%E4%BB%BF%E7%9C%9F%E6%A8%A1%E6%8B%9F'
page = WebPage()

# 监听接口
page.listen.start('/api/web/document/list')
# 发起请求
page.get(url)
for i in page.listen.steps(count=9):
    print(i.response.body)
    next_button = page.ele((By.CLASS_NAME, 'btn-next'),timeout=2)
    if next_button:
        next_button.click()
    else:
        print('没有下一页了')
        page.quit()
        break
page.quit()